package com.ch.fastbuilder.common;

import java.sql.SQLException;
import javax.sql.DataSource;

public class LocalDataSourceManager {

    private static final ThreadLocal<DataSource> localDataSource = new ThreadLocal<DataSource>();

    private LocalDataSourceManager() {
        super();
    }

    public static void setDataSource(DataSource dataSource) {
    	localDataSource.set(dataSource);
    }
    
    public static DataSource getDataSource() {
        return localDataSource.get();
    }
    
    public static void remove() {
    	localDataSource.remove();
    }
}
